import request from '@/utils/request'

// 查询待办流程任务列表
export function todoList(query) {
  return request({
    url: '/labdata/task/todoList',
    method: 'get',
    params: query
  })
}
//查询已办流程任务列表
export function doneList(query) {
  return request({
    url: '/labdata/task/doneList',
    method: 'get',
    params: query
  })
}
// 查询流程任务详细
export function getTask(taskId) {
  return request({
    url: '/labdata/task/' + taskId,
    method: 'get'
  })
}
///list/{instanceId}
export function getInstanceTaskes(instanceId) {
  return request({
    url: '/labdata/task/list/' + instanceId,
    method: 'get'
  })
}
///permit/{instanceId}
export function permit(instanceId) {
  return request({
    url: '/labdata/task/permit/' + instanceId,
    method: 'get'
  })
}
// 新增流程任务
export function addTask(data) {
  return request({
    url: '/labdata/task',
    method: 'post',
    data: data
  })
}
//签收任务/sign/{taskId}
export function signTask(taskId) {
  return request({
    url: '/labdata/task/sign/'+taskId,
    method: 'get'
  })
}
//提交任务
export function compeletedTask(data) {
  return request({
    url: '/labdata/task/compeleted',
    method: 'post',
    data: data
  })
}
//重置签收/reset/{taskId}
export function resetTask(taskId) {
  return request({
    url: '/labdata/task/reset/' + taskId,
    method: 'get'
  })
}
//撤回提交
export function withdrawTask(taskId) {
  return request({
    url: '/labdata/task/withdraw/' + taskId,
    method: 'get'
  })
}
// 修改流程任务
export function updateTask(data) {
  return request({
    url: '/labdata/task',
    method: 'put',
    data: data
  })
}

// 删除流程任务
export function delTask(taskId) {
  return request({
    url: '/labdata/task/' + taskId,
    method: 'delete'
  })
}

// 导出流程任务
export function exportTask(query) {
  return request({
    url: '/labdata/task/export',
    method: 'get',
    params: query
  })
}
